using Koala.Pro.Common;
using System.Globalization;
using System.Windows.Data;

namespace Koala.Pro.Helpers;

internal class MenuIdToNameConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value == null)
        {
            return null;
        }
        string result = "";
        if (!value.ToString().IsNullOrEmpty())
        {
            result = SecurityHelper.GetMenuName(value.ToString());
        }
        return result;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}
